package com.tanger.im.entity;

import com.tanger.common.jpa.IDEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.io.Serializable;

/**
 * @Description IM用户实体类
 * @Author Hchenbin
 * @Date 2023/12/25 16:28
 * @Version 1.0
 */
@Data
@Entity
@NoArgsConstructor
@Api(value = "IMUser", tags= " IM用户实体类")
@Table(name = "im_user",uniqueConstraints = @UniqueConstraint(columnNames= {"mobile"}))
public class ImUser extends IDEntity implements Serializable {

	@Column(columnDefinition = "bigint(20) NOT NULL COMMENT '用户ID'")
	@ApiModelProperty(value = "用户ID")
	private Long userId;
	@Column(columnDefinition = "varchar(80) NOT NULL COMMENT '昵称'")
	@ApiModelProperty(value = "昵称")
	private String nickName;
	@Column(columnDefinition = "varchar(50) DEFAULT NULL COMMENT '姓名'")
	@ApiModelProperty(value = "姓名")
	private String name;
	@Column(columnDefinition = "varchar(20) NOT NULL COMMENT '手机号'")
	@ApiModelProperty(value = "用户手机")
	private String mobile;
	@Column(columnDefinition = "varchar(255) DEFAULT NULL COMMENT '头像地址'")
	@ApiModelProperty(value = "头像地址")
	private String avatar;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '性别'")
	@ApiModelProperty(value = "性别")
    private Integer sex;
	@Column(columnDefinition = "varchar(256) DEFAULT NULL COMMENT '备注(签名)'")
	@ApiModelProperty(value = "备注(签名)")
	private String remark;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '状态(1.启用 0.禁用)'")
	@ApiModelProperty(value = "状态(1.启用 0.禁用)")
	private Integer status;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '是否删除(0.否 1.是)'")
	@ApiModelProperty(value = "是否删除(0.否 1.是)")
	private Integer isDel;
	@Column(columnDefinition = "bigint(20) NOT NULL COMMENT '创建时间'")
	@ApiModelProperty(value = "创建时间")
	private Long createTime;

	public ImUser(Long userId, Integer status, Integer isDel) {
		this.userId = userId;
		this.status = status;
		this.isDel = isDel;
	}
}
